package hn.cch.microservice.service_provider_security.security;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;


@Service(value = "securityService")
public class SecurityService implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        // 暂时只有一个账户
        if ("username".equals(username)){
            return new SecurityDetails("username", "password", "role");
        }else {
            return null;
        }
    }
}
